
package com.apes.scm.masterdata.car.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.scm.masterdata.enumeration.model.Enumeration;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;


/**
 * 功能：变速箱类型
 *
 * @Auther: linwz
 * @Date: 2018/7/23 13:52
 */

@Getter
@Setter
@Entity
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@EntityListeners(DefaultPersistListener.class)
@Table(name = GearBoxType.CONST_TABLE_NAME)
public class GearBoxType extends Model {

    public static final String CONST_TABLE_NAME = "mas_gear_box_type";

    @Id
    @Column(name = "id", length = 60)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "变速箱类型",padding = 3)
    @Comment("编码")
    private String id;//变速箱类型编码

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "gear_box_type", referencedColumnName = "id")
    @Comment("变速箱类型")
    private Enumeration gearBoxType;//变速箱类型(gearBoxType)(0:手动; 1:自动)

    @Column(name = "gears",length = 3)
    @Comment("档位")
    private int gears;//档位

    @Column(name = "description",length = 60)
    @Comment("变速器描述")
    private String description;//变速器描述

}

